﻿// --------------------------------------------------------------------------------------
// <copyright file="NotEqual.cs" company="NGroup">
// Copyright (c) NGroup. All rights reserved.
// </copyright>
// --------------------------------------------------------------------------------------
// <history>
//     <change who="Bui Thanh Nam" date="2014.01.06">Create</change>
// </history>
// --------------------------------------------------------------------------------------

namespace NGroup.VTL.Core.Routing
{
    using System.Web;
    using System.Web.Routing;

    public class NotEmpty : IRouteConstraint
    {
        public bool Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
        {
            var parameterValue = values[parameterName].ToString();
            return !string.IsNullOrWhiteSpace(parameterValue);
        }
    }
}
